package com.ruoyi.common.utils;

import com.ruoyi.common.exception.GlobalException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AssertUtils {
    private static final Logger log = LoggerFactory.getLogger(AssertUtils.class);

    public AssertUtils() {
    }

    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            log.error("断言失败: {}", message);
            throw new GlobalException(message);
        }
    }
}